@extends('Api.common.title')
@section('content')
<div style="padding: 15px;">
    <fieldset class="layui-elem-field">
        <legend>{title} - {title}列表</legend>
        <div class="layui-field-box">
            <form class="layui-form" action="">
                <div class="layui-form-item" style="text-align:center;">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input autocomplete="off" class="layui-input" placeholder="请输入ID" type="text" name="id"
                                   value="{{$select['id']}}">
                        </div>
                    </div>
                    <div class="layui-inline" style="text-align:left;">
                        <div class="layui-input-inline">
                            <button class="layui-btn"><i class="layui-icon">&#xe615;</i>查询</button>
                        </div>
                    </div>
                </div>
            </form>
            <hr>
            <div class="layui-btn-group">
                <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog" dw-url="{{URL::action('{moduleName}\{controllerName}@create')}}"
                        dw-title="新增{title}"
                        dw-width="800px" dw-height="600px">
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                <button class="layui-btn layui-btn-xs layui-btn-danger dw-batch-delete" dw-url="{{URL::action('{moduleName}\{controllerName}@delete')}}">
                    <i class="layui-icon">&#xe640;</i>删除
                </button>
                <button class="layui-btn layui-btn-xs dw-refresh">
                    <i class="layui-icon">&#x1002;</i>刷新
                </button>
            </div>
            <hr>
            <table class="layui-table">
                <colgroup>
                    <col>
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th width="50px" class="selectAll"><input type="checkbox">序号</th>
                    <th>名称</th>
                    <th style="text-align:center;">操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($list as $vo)
                <tr>
                    <td>
                        <input type="checkbox" name="id" value="{{$vo['id']}}"> {{$vo['xh']}}
                    </td>
                    <td>{{$vo['name']}}</td>
                    <td class="text-center">
                        <div class="layui-btn-group">
                            <button class="layui-btn layui-btn-xs layui-btn-normal dw-dailog"
                                    dw-width="800px" dw-height="600px"
                                    dw-url="{{URL::action('{moduleName}\{controllerName}@edit',["id"=>$vo['id']])}}"
                                    dw-title="编辑{title}">
                                <i class="layui-icon">&#xe642;</i>编辑
                            </button>
                            @if($vo["status"]  == 1)
                            <button class="layui-btn layui-btn-xs layui-btn-danger dw-delete"
                                    dw-url="change?id={{$vo['id']}}&status=2"
                                    dw-msg="是否停用"
                            >
                                <i class="layui-icon">&#xe640;</i>停用
                            </button>
                            @else
                            <button class="layui-btn layui-btn-xs  dw-delete"
                                    dw-url="change?id={{$vo['id']}}&status=1"
                                    dw-msg="是否开启"
                            >
                                <i class="layui-icon">&#xe642;</i>开启
                            </button>
                            @endif
                            <button class="layui-btn layui-btn-xs layui-btn-danger dw-delete"
                                    dw-url="{{URL::action('{moduleName}\{controllerName}@delete',["id"=>$vo['id']])}}"
                                    dw-title="{{$vo['xh']}}">
                                <i class="layui-icon">&#xe640;</i>删除
                            </button>
                        </div>
                    </td>
                </tr>
                @endforeach
                </tbody>
            </table>
            <div class="dw-page">
                {!! $list->appends(['id'=>$select['id']])->render() !!}
            </div>
        </div>
    </fieldset>
</div>
@endsection